<ui:composition template="../index/index.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="content">
		<p:fieldset legend="Lista de Contas a Pagar">
			<h:form>
				<p:dataTable value="#{requisicaoTransferenciaBean.salarios}"
					var="salario" paginator="true" rows="4">

					<f:facet name="header">  
			            Requisições de Salários
			        </f:facet>

					<p:column headerText="Beneficiario">
						<h:outputText value="#{salario.beneficiario.nome}"></h:outputText>
					</p:column>

					<p:column headerText="Data de Requisição">
						<h:outputText value="#{salario.dataRequisicao}"></h:outputText>
					</p:column>

					<p:column headerText="Data Limite">
						<h:outputText value="#{salario.dataLimite}"></h:outputText>
					</p:column>

					<p:column>
						<h:commandLink style="padding:3px"
							action="#{requisicaoTransferenciaBean.view}" value="Vizualizar">
							<f:setPropertyActionListener
								target="#{requisicaoTransferenciaBean.transferencia}"
								value="#{salario}" />
						</h:commandLink>
					</p:column>
				</p:dataTable>
			</h:form>
			
			<h:form>
			<p:dataTable value="#{requisicaoTransferenciaBean.contas}"
				var="conta" paginator="true" rows="4">

				<f:facet name="header">  
			            Requisições de Contas Gerais  
			        </f:facet>

				<p:column headerText="Beneficiario">
					<h:outputText value="#{conta.beneficiario.nome}"></h:outputText>
				</p:column>

				<p:column headerText="Data de Requisição">
					<h:outputText value="#{conta.dataRequisicao}"></h:outputText>
				</p:column>

				<p:column headerText="Data Limite">
					<h:outputText value="#{conta.dataLimite}"></h:outputText>
				</p:column>

				<p:column>
						<h:commandLink style="padding:3px"
							action="#{requisicaoTransferenciaBean.view}" value="Vizualizar">
							<f:setPropertyActionListener
								target="#{requisicaoTransferenciaBean.transferencia}"
								value="#{conta}" />
						</h:commandLink>
				</p:column>
			</p:dataTable>
			</h:form>
			
			<h:form>
				<h:commandButton action="#{requisicaoTransferenciaBean.create}"
					value="Requisitar Pagamento" />
			</h:form>
		</p:fieldset>
	</ui:define>
</ui:composition>